/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.braincasedesigns.roller.model;

import com.braincasedesigns.roller.parser.model.Modifier;
import com.braincasedesigns.roller.parser.model.RollDescription;
import com.braincasedesigns.roller.model.DicePool;
import com.braincasedesigns.roller.model.DieRoll;
import com.braincasedesigns.roller.model.DieRollResult;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author jcampbel
 */
public class GenericDicePool implements DicePool<DieRollResult, DieRoll> {

    private final int repeat;
    private final DieRoll dieRoll;

    public GenericDicePool(int repeat, DieRoll roll) {
        this.repeat = repeat;
        this.dieRoll = roll;
    }

    public List<DieRollResult> roll() {
        List<DieRollResult> results = new ArrayList<DieRollResult>(repeat);
        for (int i =0; i< repeat; i++){
            results.add(dieRoll.roll());
        }
        return results;
    }

    public int getTotal() {
        throw new UnsupportedOperationException("Not supported yet.");
    }


    public int getRepeat() {
        return repeat;
    }

    public DieRoll getDieRoll() {
        return dieRoll;
    }
}
